<template>
	<div>
		<!--头部-->
		<mt-header title="信息管理系统"></mt-header>
		<!--路由留坑-->
		<router-view></router-view>
		<!--底部-->
		<nav class="mui-bar mui-bar-tab">
			<router-link class="mui-tab-item" :to="{name:'home'}">
				<span class="mui-icon icon-home"></span>
				<span class="mui-tab-label">首页</span>
			</router-link>
			<router-link class="mui-tab-item" :to="{name:'member'}">
				<span class="mui-icon icon-huiyuan"></span>
				<span class="mui-tab-label">会员</span>
			</router-link>
			<router-link class="mui-tab-item" :to="{name:'shopcart'}">
				<span class="mui-icon icon-gouwuche1"><span class="mui-badge">{{pickNum}}</span></span>
				<span class="mui-tab-label">购物车</span>
			</router-link>
			<router-link class="mui-tab-item" :to="{name:'search'}">
				<span class="mui-icon mui-icon-search"></span>
				<span class="mui-tab-label">查找</span>
			</router-link>
		</nav>
	</div>
</template>

<script>
	import connect from './components/common/connect.js';
	import ProdTools from './components/common/prodTools.js';

	export default {
		data() {
			return {
				pickNum: ProdTools.getTotalCount()
			};
		},
		created() {
			/* this.$ajax.get('http://localhost:5080/BannerServlet').then(res => {
			     console.log(res)
			 });*/
			connect.$on("addShopCart", num => {
				this.pickNum += num;
				console.log(this.pickNum)
			});
		}
	}
</script>

<style>

</style>